package com.mobilesalon.tools;

import java.util.List;

public class StringUtils {

	public static String arrayToString(String[] a, String separator) {
	    StringBuffer result = new StringBuffer();
	    if (a.length > 0) {
	        result.append(a[0]);
	        for (int i=1; i<a.length; i++) {
	            result.append(separator);
	            result.append(a[i]);
	        }
	    }
	    return result.toString();
	}
	
	public static StringBuilder splitWithPreserveTokens(String[] elements, String separator) {
		StringBuilder string = new StringBuilder();
		for (String element : elements) {
			string.append(element).append(separator);
		}
		return string;
	}

}
